Optimal. Leaf size=202 \[ \frac {2 \left (6 a A b+3 a^2 B+5 b^2 B+10 a b C\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (14 a b B+7 b^2 (A+3 C)+a^2 (5 A+7 C)\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{21 d}+\frac {2 \left (4 A b^2+14 a b B+a^2 (5 A+7 C)\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 a (4 A b+7 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 A \sqrt {\cos (c+d x)} (b+a \cos (c+d x))^2 \sin (c+d x)}{7 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.40, antiderivative size = 202, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.163, Rules used = {4197, 3128,
3112, 3102, 2827, 2720, 2719} \begin {gather*} \frac {2 F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \left (a^2 (5 A+7 C)+14 a b B+7 b^2 (A+3 C)\right )}{21 d}+\frac {2 E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \left (3 a^2 B+6 a A b+10 a b C+5 b^2 B\right )}{5 d}+\frac {2 \sin (c+d x) \sqrt {\cos (c+d x)} \left (a^2 (5 A+7 C)+14 a b B+4 A b^2\right )}{21 d}+\frac {2 a (7 a B+4 A b) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{35 d}+\frac {2 A \sin (c+d x) \sqrt {\cos (c+d x)} (a \cos (c+d x)+b)^2}{7 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2719
Rule 2720
Rule 2827
Rule 3102
Rule 3112
Rule 3128
Rule 4197
Rubi steps
\begin {align*} \int \cos ^{\frac {7}{2}}(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \frac {(b+a \cos (c+d x))^2 \left (C+B \cos (c+d x)+A \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 A \sqrt {\cos (c+d x)} (b+a \cos (c+d x))^2 \sin (c+d x)}{7 d}+\frac {2}{7} \int \frac {(b+a \cos (c+d x)) \left (\frac {1}{2} b (A+7 C)+\frac {1}{2} (5 a A+7 b B+7 a C) \cos (c+d x)+\frac {1}{2} (4 A b+7 a B) \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 a (4 A b+7 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 A \sqrt {\cos (c+d x)} (b+a \cos (c+d x))^2 \sin (c+d x)}{7 d}+\frac {4}{35} \int \frac {\frac {5}{4} b^2 (A+7 C)+\frac {7}{4} \left (6 a A b+3 a^2 B+5 b^2 B+10 a b C\right ) \cos (c+d x)+\frac {5}{4} \left (4 A b^2+14 a b B+a^2 (5 A+7 C)\right ) \cos ^2(c+d x)}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 \left (4 A b^2+14 a b B+a^2 (5 A+7 C)\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 a (4 A b+7 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 A \sqrt {\cos (c+d x)} (b+a \cos (c+d x))^2 \sin (c+d x)}{7 d}+\frac {8}{105} \int \frac {\frac {5}{8} \left (14 a b B+7 b^2 (A+3 C)+a^2 (5 A+7 C)\right )+\frac {21}{8} \left (6 a A b+3 a^2 B+5 b^2 B+10 a b C\right ) \cos (c+d x)}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 \left (4 A b^2+14 a b B+a^2 (5 A+7 C)\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 a (4 A b+7 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 A \sqrt {\cos (c+d x)} (b+a \cos (c+d x))^2 \sin (c+d x)}{7 d}+\frac {1}{5} \left (6 a A b+3 a^2 B+5 b^2 B+10 a b C\right ) \int \sqrt {\cos (c+d x)} \, dx+\frac {1}{21} \left (14 a b B+7 b^2 (A+3 C)+a^2 (5 A+7 C)\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 \left (6 a A b+3 a^2 B+5 b^2 B+10 a b C\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (14 a b B+7 b^2 (A+3 C)+a^2 (5 A+7 C)\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{21 d}+\frac {2 \left (4 A b^2+14 a b B+a^2 (5 A+7 C)\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 a (4 A b+7 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 A \sqrt {\cos (c+d x)} (b+a \cos (c+d x))^2 \sin (c+d x)}{7 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 4 in
optimal.
time = 6.93, size = 2361, normalized size = 11.69 \begin {gather*} \text {Result too large to show} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(705\) vs.
\(2(238)=476\).
time = 0.16, size = 706, normalized size = 3.50
method | result | size |
default | \(-\frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (240 A \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}+\left (-360 A \,a^{2}-336 a A b -168 a^{2} B \right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (280 A \,a^{2}+336 a A b +140 A \,b^{2}+168 a^{2} B +280 a b B +140 a^{2} C \right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-80 A \,a^{2}-84 a A b -70 A \,b^{2}-42 a^{2} B -140 a b B -70 a^{2} C \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+25 A \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, a^{2}+35 A \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, b^{2}-126 A \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, a b +70 B \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, a b -63 B \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, a^{2}-105 B \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, b^{2}+35 C \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, a^{2}+105 C \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, b^{2}-210 C \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, a b \right )}{105 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(706\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 1.46, size = 281, normalized size = 1.39 \begin {gather*} \frac {2 \, {\left (15 \, A a^{2} \cos \left (d x + c\right )^{2} + 5 \, {\left (5 \, A + 7 \, C\right )} a^{2} + 70 \, B a b + 35 \, A b^{2} + 21 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) - 5 \, \sqrt {2} {\left (i \, {\left (5 \, A + 7 \, C\right )} a^{2} + 14 i \, B a b + 7 i \, {\left (A + 3 \, C\right )} b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) - 5 \, \sqrt {2} {\left (-i \, {\left (5 \, A + 7 \, C\right )} a^{2} - 14 i \, B a b - 7 i \, {\left (A + 3 \, C\right )} b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - 21 \, \sqrt {2} {\left (-3 i \, B a^{2} - 2 i \, {\left (3 \, A + 5 \, C\right )} a b - 5 i \, B b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 21 \, \sqrt {2} {\left (3 i \, B a^{2} + 2 i \, {\left (3 \, A + 5 \, C\right )} a b + 5 i \, B b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right )}{105 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.69, size = 303, normalized size = 1.50 \begin {gather*} \frac {C\,a^2\,\left (\frac {2\,\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )}{3}+\frac {2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{3}\right )}{d}+\frac {2\,A\,b^2\,\left (\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )+\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )\right )}{3\,d}+\frac {2\,B\,b^2\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,C\,b^2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,B\,a\,b\,\left (\frac {2\,\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )}{3}+\frac {2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{3}\right )}{d}+\frac {4\,C\,a\,b\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}-\frac {2\,A\,a^2\,{\cos \left (c+d\,x\right )}^{9/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {9}{4};\ \frac {13}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{9\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {2\,B\,a^2\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {4\,A\,a\,b\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________